package tgc.edu.xzy.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="xzy_student")
public class Student {
	private Integer id;
	private String name;
	private String sex;
	private String username;
	private String password;
	private String post;
	private TbClass tbClass;
	private List<Grade> list = new ArrayList<>();
	
	@OneToMany(mappedBy="student")
	public List<Grade> getList() {
		return list;
	}
	public void setList(List<Grade> list) {
		this.list = list;
	}
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getPost() {
		return post;
	}
	public void setPost(String post) {
		this.post = post;
	}
	@ManyToOne
	public TbClass getTbClass() {
		return tbClass;
	}
	public void setTbClass(TbClass tbClass) {
		this.tbClass = tbClass;
	}
	public Student(Integer id, String name, String sex, String username, String password, String post, TbClass tbClass,
			List<Grade> list) {
		super();
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.username = username;
		this.password = password;
		this.post = post;
		this.tbClass = tbClass;
		this.list = list;
	}
	public Student() {
		super();
	}
	
	
}
